/**
 * Author: runlin.tang
 * Creation Time: 2016-06-29.
 * Description:.无线设置接口请求
 */
define(['jquery','../../common/ajax/ajax'],
    function($,ajax) {
        function example(){
            ajax({
                url:interfaces.get_user_list.url,
                dataType:interfaces.get_user_list.dataType,
                type:interfaces.get_user_list.type,
                contentType: 'application/json',
                cache:{
                    use:false,
                    name:'',
                    time:10
                },
                isOk:function(data){
                    var datas = '';
                    if(useNetData){
                        datas = data;
                    }else{
                        datas = data.get_user_list;
                    }
                    var html = '';
                    html+='<div class="header"><a href="/h5-wizard/index.html#advanced-setting" class="back-a"></a><p>客户端列表</p><a class="header-right refresh">刷新</a></div>';
                    html+='<div class="content">';
                    html+='<div class="client-contain">';
                    html+='<div class="client-span"><span>主机名</span><span>IP地址</span><span class="fr">MAC地址</span></div>';

                    var liHtml = '';
                    var arrLength = (Object.keys(datas.data)).length + 1;
                    for(var i=1;i<arrLength;i++){
                        liHtml += '<div class="client-span client-content"><span>'+datas.data[i]+'</span><span>'+datas.ip[i]+'</span><span>'+datas.mac[i]+'</span></div>';
                    }
                    html+=liHtml;

                    html+='</div>';
                    html+='</div>';
                    html+='<div class="footer">';
                    html+='<a href="/h5-wizard/index.html#advanced-setting">';
                    html+='<span class="footer-icon footer-icon-one"></span>';
                    html+='<p>系统状态</p>';
                    html+='</a>';
                    html+='<a href="/h5-wizard/index.html#line-management">';
                    html+='<span class="footer-icon footer-icon-two"></span>';
                    html+='<p>线装管理</p>';
                    html+='</a>';
                    html+='<a href="/h5-wizard/index.html#no-report">';
                    html+='<span class="footer-icon footer-icon-three"></span>';
                    html+='<p>数据上报</p>';
                    html+='</a>';
                    html+='<a href="/h5-wizard/index.html#advanced-setting" class="footer-Er">';
                    html+='<span class="footer-icon footer-icon-four"></span>';
                    html+='<p>高级设置</p>';
                    html+='</a>';
                    html+='</div>';
                    $('.webApp-content').html(html);
                    $(".refresh").on('click',function(){
                        example();
                    });
                }
            });
        }
        return example;
    });